<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>鹿鸣阁后台管理系统</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/common/layui/css/layui.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/admin/css/login.css">
    <script src="${pageContext.request.contextPath}/static/common/layui/layui.js"></script>
    <link rel="shortcut icon" href="../views/static/admin/img/favicon.ico"/>
</head>
<style>
    form .btn {
        width: 300px;
        height: 40px;
        margin-top: 28px;
        margin-left: 30px;
        color: #fff;
        border: none;
        background: linear-gradient(133deg, #a4c4f3 0%, #31a4f1 100%);
        box-shadow: 0px 15px 15px -10px rgba(71, 177, 248, 0.5), 0px -10px 30px -10px rgba(71, 177, 248, 0.5);
    }
    .login-header {
        height: 80px;
        border-bottom: 1px solid #47b1f8;
        margin-bottom: 50px;
    }
    .login-header h4 {
        color: #47b1f8;
        text-align: center;
        line-height: 80px;
        font-size: 20px;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
    }
    .copyright {
            position: absolute;
            top: 690px;
            left: 50%; transform: translateX(-50%);
            color: rgba(0,0,0,.45);
            font-size: 14px;
        }
</style>

<script>
    $(function () {
        $("#summit").click(function () {
            $.post("admin/login",$("#form").serialize(),function (data) {
                alert("進入了方法")
                if (data == null){
                    alert("用戶名或密碼錯誤~");
                }else {
                    location.href = "index.jsp";
                }
            },"json");
        });
    });

</script>
<body id="login">
<div class="login">
    <div class="login-header">
        <h4>欢迎登录鹿鸣阁后台管理系统</h4>
    </div>
    <form id="form" class="layui-form" target="_self" method="post" action="${pageContext.request.contextPath}/admin/login">
        <div class="layui-form-item" style="width: 70%;padding-left: 55px;margin-top: 15px;">
            <input type="text" name="username"  id="username" placeholder="用户名" class="layui-input" required>
            <i class="layui-icon input-icon" style="padding-left: 23px;">&#xe66f;</i>
        </div>
        <div class="layui-form-item" style="width: 70%;padding-left: 55px;">
            <input type="password" name="password" id="password" placeholder="密码"  class="layui-input" required>
            <i class="layui-icon input-icon" style="padding-left: 23px;">&#xe673;</i>
        </div>
        <div class="layui-form-item" style="margin-top: 12px;">
            <button id="summit" class=" btn" lay-submit lay-filter="login" >立即登录</button>
        </div>
        <br>
    </form>
</div>
<div class="copyright">Copyright&copy; 2021 广东金融学院 Java项目课程设计</div>
</body>
</html>
